from django.contrib import admin
from .models import *

# Register your models here.
@admin.register(Employees)
class EmployeesAdmin(admin.ModelAdmin):
    list_display=('id', 'userid', 'name', 'mobile', 'email', 'created_at', 'qrcode_colored')
    #list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 20
    exclude = ('created_at', 'deviceid')

@admin.register(Members)
class MembersAdmin(admin.ModelAdmin):
    list_display=('id', 'openid', 'name', 'mobile', 'employee', 'created_at', 'wx_colored')
    #list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 20

@admin.register(Cards)
class CardsAdmin(admin.ModelAdmin):
    list_display = ('id', 'card_id', 'card_name', 'created_at')
    #list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 20

@admin.register(MemberCards)
class MemberCardsAdmin(admin.ModelAdmin):
    list_display = ('id', 'member', 'card', 'card_code', 'status_colored')
    list_per_page = 20
    search_fields = ('member',)

@admin.register(System)
class SystemAdmin(admin.ModelAdmin):
    list_display=('id', 'name', 'content')
    #list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 20